package com.fr.report.core.cal;

import com.fr.base.ModuleContext;
import com.fr.general.FArray;
import com.fr.main.impl.WorkBook;
import com.fr.main.page.PageWorkBook;
import com.fr.report.ECReport;
import com.fr.report.module.EngineModule;
import junit.framework.TestCase;

import java.util.HashMap;

public class SeTest_Old extends TestCase {
	public void setUp() throws Exception {
		ModuleContext.startModule(EngineModule.class.getName());
	}

	public void testResolveColumnRowRange(){
		try {
			WorkBook wbTpl = new WorkBook();
			wbTpl.readStream(
					SeTest_Old.class.getClassLoader().getResourceAsStream("com/fr/report/core/test_resolve_column_row.cpt"));
			PageWorkBook resultBook = wbTpl.execute(new HashMap());
			
			ECReport resultReport = (ECReport)resultBook.getReport(0);
			
			for (int row = 0; row < resultReport.getRowCount(); row ++) {
				Object a1 = resultReport.getCellValue(0, row);
				FArray expected = new FArray(new Object[] {
						resultReport.getCellValue(2, row), resultReport.getCellValue(3, row), 
						resultReport.getCellValue(4, row), resultReport.getCellValue(5, row), 
						});
				assertEquals(expected, a1);
			}
		} catch (Exception e) {
			e.printStackTrace();
			fail(e.getMessage());
		}
	}
}
